package com.cty.Stack;


import org.junit.Test;

public class ArrayStackDemo {
    @Test
    public void Test() {
        ArrayStack arrayStack = new ArrayStack(4);
        try {
            arrayStack.push(1);
            arrayStack.push(2);
            arrayStack.push(3);
            arrayStack.push(4);
            arrayStack.push(4);
            arrayStack.list();
            System.out.println(arrayStack.pop());
            System.out.println(arrayStack.pop());
            System.out.println(arrayStack.pop());
            System.out.println(arrayStack.pop());
            System.out.println(arrayStack.peek());
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

    }
}
